﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Web.UI;
using Antu.WebControls;
using Antu.Core.Components;
using Antu.Core.Services;
using System.Web.UI.WebControls;
using EluZSProvider;
using System.Web;
using System.Data;

namespace WebSys.UI.Control.ZhengShou
{
    public class XF_JDJLInfoControl : MPBasicTemplate
    {
        EluZSDataProvider _EluZSDataProvider = (EluZSDataProvider)ProviderService.ProviderServiceMange.GetProvider("EluZSProvider");

        Label 区属, 项目名称, 立项号, 征收实施单位, 征收许可证号, 接待员;
        public string userid = string.Empty;
        protected override void OnLoad(EventArgs e)
        {
            if (HttpContext.Current.Session["UserID"] == null)
            {
                Antu.Utilities.UtilitiesPage.AlertDialogClear("登录超时，请重新登录！", "window.parent.location.href('../login.aspx');");
            }
            else
            {
                userid = HttpContext.Current.Session["UserID"].ToString();
            }
            base.OnLoad(e);
            InitControl();
            if (!base.Page.IsPostBack)
            {
                Bind();
            }
        }
        protected void InitControl() {
            区属 = (Label)FindControl("区属");
            项目名称 = (Label)FindControl("项目名称");
            立项号 = (Label)FindControl("立项号");
            征收实施单位 = (Label)FindControl("征收实施单位");
            征收许可证号 = (Label)FindControl("征收许可证号");
            接待员 = (Label)FindControl("接待员");
        }
        protected void Bind() {
            string strid = base.Page.Request["ID"];
            string strpnid = base.Page.Request["PNID"];
            if (!string.IsNullOrEmpty(strpnid)) {
                EluZSProvider.Project project = _EluZSDataProvider.GetProjectXX(strpnid);
                区属.Text = project.区属;
                项目名称.Text = project.项目名称;
                立项号.Text = project.立项号;
                征收实施单位.Text = project.征收实施单位;
                征收许可证号.Text = _EluZSDataProvider.GetString("select 征收许可证号 from zs_prono where pid='" + strpnid + "'");
            }
            if (!string.IsNullOrEmpty(strid)) {
                接待员.Text = _EluZSDataProvider.GetSomeStr("ZS_XINFANG", "接待员", "id", strid);
            }
        }
    }
}


